home *** CD-ROM | disk | FTP | other *** search
/ Clickx 115 / Clickx 115.iso / software / tools / windows / tails-i386-0.16.iso / live / filesystem.squashfs / usr / include / scribus-ng / bookmwin.h < prev    next >
Encoding:
C/C++ Source or Header  |  2007-09-09  |  3.5 KB  |  114 lines

  1. /*
  2. For general Scribus (>=1.3.2) copyright and licensing information please refer
  3. to the COPYING file provided with the program. Following this notice may exist
  4. a copyright and/or license notice that predates the release of Scribus 1.3.2
  5. for which a new license (GPL+exception) is in place.
  6. */
  7. /***************************************************************************
  8.                           bookmwin.h  -  description
  9.                              -------------------
  10.     begin                : Mon Feb 11 2002
  11.     copyright            : (C) 2002 by Franz Schmid
  12.     email                : Franz.Schmid@altmuehlnet.de
  13.  ***************************************************************************/
  14.  
  15. /***************************************************************************
  16.  *                                                                         *
  17.  *   This program is free software; you can redistribute it and/or modify  *
  18.  *   it under the terms of the GNU General Public License as published by  *
  19.  *   the Free Software Foundation; either version 2 of the License, or     *
  20.  *   (at your option) any later version.                                   *
  21.  *                                                                         *
  22.  ***************************************************************************/
  23.  
  24. #ifndef BOOKMWIN_H
  25. #define BOOKMWIN_H
  26.  
  27. #include <QTreeWidget>
  28.  
  29. class PageItem;
  30. #include "scribusapi.h"
  31. #include "scribusdoc.h"
  32.  
  33. /*! \brief Tree widget item for PDF Bookmarks.
  34. Secret items like Pare, First, Last etc. are PDF Outlines
  35. attributes. See PDF specification for more info.
  36. These attrs are recomputed in the BookMView::rebuildTree()
  37. method.
  38. @author Franz Schmid
  39. */
  40. class SCRIBUS_API BookMItem : public QTreeWidgetItem
  41. {
  42. public:
  43.     BookMItem(QTreeWidgetItem* parent, struct ScribusDoc::BookMa *Bm);
  44.     BookMItem(QTreeWidgetItem* parent, QTreeWidgetItem* after, struct ScribusDoc::BookMa *Bm);
  45.     BookMItem(QTreeWidget* parent, QTreeWidgetItem* after, struct ScribusDoc::BookMa *Bm);
  46.     BookMItem(QTreeWidget* parent, struct ScribusDoc::BookMa *Bm);
  47.     BookMItem(QTreeWidget* parent, QTreeWidgetItem* after, int nr, PageItem *PObject);
  48.     BookMItem(QTreeWidget* parent, int nr, PageItem *PObject);
  49.     ~BookMItem() {};
  50.     void SetUp(struct ScribusDoc::BookMa *Bm);
  51.     virtual QString key(int, bool) const;
  52.     PageItem *PageObject;
  53.     int ItemNr;
  54.     int PdfObj;
  55.     QString Action;
  56.     QString Titel;
  57.     int First;
  58.     int Last;
  59.     int Prev;
  60.     int Next;
  61.     int Pare;
  62.  
  63.     int level();
  64. };
  65.  
  66.  
  67. /*! \brief Tree widget for PDF Bookmarks.
  68. It's a minimal tree implementation with D'n'D handled
  69. in Qt4 itself. It could be rewritten into M/V/C stuff
  70. later, but it looks it's simpler and quicker now.
  71. MarkMoved() signal stores bookmarks in the ScribusDoc.
  72. @author Franz Schmid
  73. \author Petr Vanek <petr@scribus.info>
  74. */
  75. class SCRIBUS_API BookMView : public QTreeWidget
  76. {
  77.     Q_OBJECT
  78.  
  79. public:
  80.     BookMView(QWidget* parent);
  81.     ~BookMView() {};
  82.     void AddItem(QString text, QString Tit, PageItem *PageObject);
  83.     void DeleteItem(PageItem *PageObject);
  84.     void SetAction(PageItem *currItem, QString Act);
  85.  
  86.     int NrItems;
  87.     int First;
  88.     int Last;
  89.  
  90.     /*! \brief Build scribus bookmark structure from tree items.
  91.     It looks horrible as it performs full rescan of the tree, but
  92.     it's pretty fast at all.
  93.     \author Petr vanek <petr@scribus.info>
  94.     */
  95.     void rebuildTree();
  96.  
  97. public slots:
  98.     void AddPageItem(PageItem* ite);
  99.     void ChangeText(PageItem *currItem);
  100.  
  101. signals:
  102.     void MarkMoved();
  103.     void SelectElement(PageItem *);
  104.     void changed();
  105.  
  106. protected:
  107.     void dropEvent(QDropEvent *e);
  108.  
  109.     private slots:
  110.         void setPageItem(QTreeWidgetItem * old, QTreeWidgetItem * newItem);
  111. };
  112.  
  113. #endif
  114.